<?php
/*
	[gunianwang system]
	NAME:jobs_model
	AUTHOR:hl
	DATE:2012-07-02
*/
if (!defined('IN_ELS'))
{
    die('Hacking attempt');
}

class jobsbase extends base {
	function jobsbase() {
		$this->base();
	}
	//添加入库操作
	function insertjobs($data){
		$retValue = $this->dbInsert("gnw_jobs",$data);
		return $retValue;
	}
	//删除操作
	function deletejobs($where){
		$retValue = $this->dbDelete("gnw_jobs",$where);
	}
	//修改操作
	function updatejobs($data,$where){
		$retValue = $this->dbUpdate("gnw_jobs",$data,$where);
		return $retValue;
	}
	//查询数量操作
	function getjobsCount($where){
		$sqlText = "select count(*) from gnw_jobs ";
		$sqlText .= $where;
		$data=$this->db->result_first($sqlText);
		return $data;
	}
	//查询列表操作
	function getjobsList($where,$limitText){
		$sqlText  = "select *,FROM_UNIXTIME(create_time,'%Y-%m-%d %H:%i:%s') create_time,FROM_UNIXTIME(e_time,'%Y-%m-%d %H:%i:%s') e_time from gnw_jobs ";
		$sqlText .= $where;
		$sqlText .= " order by create_time desc ";
		$sqlText .= $limitText;
		$data=$this->db->fetch_all($sqlText);
		return $data;
	}
	//查询单条数据操作
	function getjobsContent($jobs_id){
		$sqlText = "select *,FROM_UNIXTIME(s_time,'%Y-%m-%d') s_time,FROM_UNIXTIME(e_time,'%Y-%m-%d') e_time from gnw_jobs where jobs_id=".$jobs_id;
		$data=$this->db->fetch_first($sqlText);
		return $data;
	}
}


?>